<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: media_content.php 181 2013-09-22 07:56:14Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 181 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:56:14 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

require ('includes/application_top.php');

$content_data = $db->db_query("SELECT
									content_name,
									content_read,
									content_file
								FROM 
									".TABLE_PRODUCTS_CONTENT."
								WHERE 
									content_id='".(int) $_GET['coID']."'");

$db->db_query("UPDATE
					".TABLE_PRODUCTS_CONTENT."
				SET 
					content_read=content_read+1
				WHERE 
					content_id='".(int)$_GET['coID']."'");
?>
<!DOCTYPE html>
<html <?php echo HTML_PARAMS; ?>>
	<head>
		<title><?php echo $content_data->fields['content_name']; ?></title>
		<link rel="stylesheet" type="text/css" href="<?php echo 'templates/'.CURRENT_TEMPLATE.'/css/popup.css'; ?>">
		</script>
	</head>
<body>
<?php
if ($content_data->fields['content_file'] != '') {
	if (strpos($content_data->fields['content_file'], '.txt'))
		echo '<pre>';

	if (preg_match('/\.gif/i', $content_data->fields['content_file']) or preg_match('/\.jpg/i', $content_data->fields['content_file']) or preg_match('/\.png/i', $content_data->fields['content_file']) or preg_match('/\.tif/i', $content_data->fields['content_file']) or preg_match('/\.bmp/i', $content_data->fields['content_file'])) {
		echo '<div>';
		echo image(DIR_WS_CATALOG.'media/products/'.$content_data->fields['content_file']);
		echo '</div>';
	} else {
		echo '<div>';
		include (DIR_FS_CATALOG.'media/products/'.$content_data->fields['content_file']);
		echo '</div>';
	}

	if (strpos($content_data->fields['content_file'], '.txt'))
		echo '</pre>';
}
?>
</body>
</html>